package com.management.service.Impl;

import com.management.dao.AuthorityDao;
import com.management.po.Authority;
import com.management.service.AuthorityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author XS
 * 权限业务逻辑实现类类
 * @version 1.0
 */
@Service
public class AuthorityServiceImpl implements AuthorityService {
    @Autowired
    AuthorityDao authorityDao;
    @Override
    public List<Authority> findAll() {
        return authorityDao.findAll();
    }

    @Override
    public Authority findById(int authorityId) {
        return authorityDao.findById(authorityId);
    }

    @Override
    public List<Authority> findByType(int authorityType) {
        return authorityDao.findByType(authorityType);
    }

    @Override
    public boolean add(Authority authority) {
        return authorityDao.add(authority)>0?true:false;
    }

    @Override
    public boolean update(Authority authority) {
        return authorityDao.update(authority)>0?true:false;
    }
}
